package richbar.com.richbar.adapter.product;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.okhttp.GlideUtil;

import java.util.List;

import richbar.com.richbar.R;
import richbar.com.richbar.base.BaseListAdapter;
import richbar.com.richbar.bean.ShopResult;
import richbar.com.richbar.util.NetWorkUtil;

/**
 * Created by QiYang on 2018/12/11.
 */

public class NavAdapter extends BaseListAdapter<ShopResult.DataEntity.Navlist> {
    public NavAdapter(Context context, List<ShopResult.DataEntity.Navlist> data) {
        super(context, data);
    }

    @Override
    public View convert(int i, View view, ViewGroup viewGroup, ShopResult.DataEntity.Navlist bean) {
        View v = inflater.inflate(R.layout.item_nav,null);
        TextView tv = v.findViewById(R.id.tv);
        ImageView iv = v.findViewById(R.id.iv) ;
        GlideUtil.loadImage(context, NetWorkUtil.URL + bean.getImg(),iv);
        tv.setText(bean.getName());
        return v;
    }
}
